<%-- 
    Document   : login
    Created on : Dec 12, 2009, 2:32:52 PM
    Author     : ppt
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<HTML>
    <HEAD>
        <TITLE>Login using jsp</TITLE>
    </HEAD>

    <BODY>
        <H1>LOGIN FORM</H1>
        <%
                    String myname = (String) session.getAttribute("username");

                    if (myname != null) {
                        out.println("Welcome  " + myname + "  , <a href=\"logout.jsp\" >Logout</a>");
                    } else {
        %>
        <form action="checkLogin.jsp">
            <table>
                <tr>
                    <td> Username  : </td><td> <input name="username" size=15 type="text" /> </td>
                </tr>
                <tr>
                    <td> Password  : </td><td> <input name="password" size=15 type="password" /> </td>
                </tr>
            </table>
            <input type="submit" value="login" />
        </form>
        <%           }


        %>

    </BODY>
</HTML>